package com.mobileares.midp.demo.client.page;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Widget;
import com.mobileares.midp.widgets.client.list.ListWidget;
import com.mobileares.midp.widgets.client.list.MultiListWidget;
import com.mobileares.midp.widgets.client.textbox2.widget.ListBox;

/**
 * Created by IntelliJ IDEA.
 * User: Tom
 * Date: 2011-7-22
 * Time: 16:20:29
 * To change this template use File | Settings | File Templates.
 */
public class List extends Composite {
    private FlowPanel panel;
    public List(){
        panel = new FlowPanel();
        initWidget(panel);
        panel.add(getListWidget());
        panel.add(new HTML("<br/>"));
        panel.add(getMultiListWidget());
        panel.add(new HTML("<br/>"));
        panel.add(getListBox());
    }
        private Widget getListWidget() {
        ListWidget list = new ListWidget();
        list.setWidth("300px");
        list.addItem("小明明1");
        list.addItem("小明明2");
        list.addItem("小明明3");
        list.addItem("小明明4");
        list.addItem("小明明5");
        return list;
    }

    private Widget getMultiListWidget() {
        MultiListWidget list = new MultiListWidget();
        list.setWidth("300px");
        list.addItem("小明明1");
        list.addItem("小明明2");
        list.addItem("小明明3");
        list.addItem("小明明4");
        list.addItem("小明明5");
        return list;
    }
         private Widget getListBox() {
        ListBox box = new ListBox();
        box.addItem("伦敦1", "ld1");
        box.addItem("伦敦2", "ld2");
        box.addItem("伦敦3", "ld3");
        box.addItem("伦敦4", "ld4");
        return box;
    }
}
